#Dump of python shell history
import os, fnmatch
try:
    import xml.etree.cElementTree as ET
except ImportError:
    import xml.etree.ElementTree as ET
xmldoc = ET.ElementTree(conf)
conf = ('./domain.xml')
xmldoc = ET.ElementTree(conf)
root = xmldoc.getroot()
print root
intface = root.find('interfaces')
print intface
xmldoc.getroot()
xmldoc = ET.ElementTree(file='domain.xml')
root = xmldoc.getroot()
print type(xmldoc)
print type(root)
print root
intface = root.find('interfaces')
print type(intface)
intface = root.find('interface')
print type(intface)
root.tag
root.attrib
for child_of_root in root:
 print child_of_root.tag, child_of_root.attrib
root[7].tag
root[6].tag
root[6].tag, root[6].text
print root[6].tag
for elem in xmldoc.iter(tag='{urn:jboss:domain:1.5}server-groups'):
 print elem.text
for child in root
for child in root:
 print child.tag, child.attrib
root[0][1].text
root[6][1].text
root[6][2].text
root[6][0].text
root[6][0]
for socket in root.iter('socket-binding'):
 print socket.attrib
for socket in root.iter('socket-binding-groups'):
 print socket.attrib
root.iter('socket-binding-groups')
for soc in root.iter('{urn:jboss:domain:1.5}socket-binding-groups'):
 print soc.attrib
root.findall('socket-binding')
root.findall('socket-binding-groups')
root.findall('{urn:jboss:domain:1.5}socket-binding-groups')
for soc in root.findall('{urn:jboss:domain:1.5}socket-binding-groups'):
 print soc
for soc in root.findall('{urn:jboss:domain:1.5}socket-binding-groups'):
 print soc.attrib
list(root)
list(root.iter())

list(root.iter())
for a in list(root.iter()):
 print a
for a in list(root.iter()):
 print a.attrib
for a in list(root.iter()):
 print a.tag, a.attrib
list (root.iter('socket-binding')
)
list (root.iter('socket-binding'))
list (root.iter('{urn:jboss:domain:1.5}socket-binding-group'))
for a in list (root.iter('{urn:jboss:domain:1.5}socket-binding-group')):
 print a.tag, a.attrib
for a in list (root.iter('{urn:jboss:domain:1.5}socket-binding-group ')):
 print a.subtag, a.subattrib
for a in root.findall('.//*'):
 print a.tag, a.attrib
for a in root.findall('{urn:jboss:domain:1.5}socket-binding'):
 print a.tag, a.attrib
for a in root.findall('{urn:jboss:domain:1.5}socket-binding-group'):
 print a.tag, a.attrib
for a in list(root.findall('{urn:jboss:domain:1.5}socket-binding-group')):
 print a.tag, a.attrib
for a in list(root.findall('{urn:jboss:domain:1.5}socket-binding-group')):
 print a.tag, a.attrib
for a in list(root.iter('{urn:jboss:domain:1.5}socket-binding-group')):
 print a.tag, a.attrib
for a in list(root.iter('*socket-binding-group')):
 print a.tag, a.attrib
for a in list(root.iter('.//*socket-binding-group')):
 print a.tag, a.attrib
for a in list(root.findall('.//*socket-binding-group')):
 print a.tag, a.attrib
for a in root.findall('.//*socket-binding-group'):
 print a.tag, a.attrib
for a in list(root.iter('{urn:jboss:domain:1.5}socket-binding-group')):
 print a.attrib
for a in root.iterfind('socket-binding-group'):
for a in root.iterfind('socket-binding-group'):
 print a.tag
print root
root.iterfind('socket-binding-group'):
root.iterfind('socket-binding-group')
for a in list(root.iter('{urn:jboss:domain:1.5}socket-binding-group')):
 print a.attrib
for a in list(root.iter('{urn:jboss:domain:1.5}socket-binding-group')):
 for b in a
for a in list(root.iter('{urn:jboss:domain:1.5}socket-binding-group')):
 for b in a:
  print b.tag, b.attrib
for a in list(root.iter('{urn:jboss:domain:1.5}socket-binding-group')):
    for b in a:
         print a.tag, a.attrib, b.tag, b.attrib
for a in list(root.iter('{urn:jboss:domain:1.5}socket-binding-group')):
 for b in a:
  print b[1].attib
for a in list(root.iter('{urn:jboss:domain:1.5}socket-binding-group')):
 for b in a:
  print b[1].attrib
for a in list(root.iter('{urn:jboss:domain:1.5}socket-binding-group')):
 for b in a:
  print b[0].attrib
for a in list(root.iter('{urn:jboss:domain:1.5}socket-binding-group')):
 for b in a:
  print b.attrib
print root[6].tag
xml_file=('domain.xml')
import xml.etree.cElementTree as ET
def parseXML(xml_file):
    """
    Parse XML with ElementTree
    """
    tree = ET.ElementTree(file=xml_file)
    print tree.getroot()
    root = tree.getroot()
    print "tag=%s, attrib=%s" % (root.tag, root.attrib)
 
    for child in root:
        print child.tag, child.attrib
        if child.tag == "appointment":
            for step_child in child:
                print step_child.tag
 
    # iterate over the entire tree
    print "-" * 40
    print "Iterating using a tree iterator"
    print "-" * 40
    iter_ = tree.getiterator()
    for elem in iter_:
        print elem.tag
 
    # get the information via the children!
    print "-" * 40
    print "Iterating using getchildren()"
    print "-" * 40
    appointments = root.getchildren()
    for appointment in appointments:
        appt_children = appointment.getchildren()
        for appt_child in appt_children:
            print "%s=%s" % (appt_child.tag, appt_child.text)
if __name__ == "__main__":
 parseXML("domain.xml")
root = xmldoc.getroot()
print root
import readline
for i in range(readline.get_current_history_length()):
    print readline.get_history_item(i)
for a in list(root.iter()):
 print a.attrib
for a in list(root.iter()):
 print a.tag
import readline
for i in range(readline.get_current_history_length()):
    print readline.get_history_item(i)
for a in list(root.iter('{urn:jboss:domain:1.5}socket-binding-group')):
 print a.attrib
for a in list(root.iter('{urn:jboss:domain:1.5}main-server-group')):
 print a.tag
for child in root:
 print child.tag, child.attrib
for a in list(root.iter('{urn:jboss:domain:1.5}server-group')):
 print a.tag, a.attrib
for a in list(root.iter('{urn:jboss:domain:1.5}server-group')):
 for b in a:
  print b.tag, b.attrib
for a in list(root.iter('{urn:jboss:domain:1.5}server-group')):
 for b in a:
  for c in b:
   print c.tag, c.attrib
for a in list(root.iter('{urn:jboss:domain:1.5}server-group')):
 for b in a:
  for c in b:
   print a.tag, b.tag, c.tag, c.attrib
for a in list(root.iter('{urn:jboss:domain:1.5}server-group')):
 for b in a:
  for c in b:
   print a.attrib, b.tag, c.tag, c.attrib
for a in list(root.iter('{urn:jboss:domain:1.5}server-group')):
 for b in a:
  for c in b:
   print a.attrib, c.tag, c.attrib
for a in list(root.iter('{urn:jboss:domain:1.5}server-group')):
 for b in a:
  for c in b:
   print a.attrib, b.attrib, c.tag, c.attrib
 for b in a:for a in list(root.iter('{urn:jboss:domain:1.5}server-group')):

  for c in b:
   print a[3].attrib, b[1].attrib, c[1].tag, c.attrib
for a in list(root.iter('{urn:jboss:domain:1.5}server-group')):
 name = a.attrib.splt{:}[2]
for a in list(root.iter('{urn:jboss:domain:1.5}server-group')):
 name = a.attrib.split{:}[2]
for a in list(root.iter('{urn:jboss:domain:1.5}server-group')):
 name = a.attrib.split{':'}[2]
 name = str(a.attrib).split{':'}[2]
for a in list(root.iter('{urn:jboss:domain:1.5}server-group')):
 name = str(a.attrib).split{':'}[2]
for a in list(root.iter('{urn:jboss:domain:1.5}server-group')):
 name = (str(a.attrib)).split{':'}[2]
for a in list(root.iter('{urn:jboss:domain:1.5}server-group')):
 name = a.attrib.split(':')[2]
for a in list(root.iter('{urn:jboss:domain:1.5}server-group')):
 name = str(a.attrib).split(':')[2]
 print name
for a in list(root.iter('{urn:jboss:domain:1.5}server-group')):
 name = str(a.attrib).split(':')[2].split('}')[0]
 print name
import readline
for i in range(readline.get_current_history_length()):
>>> 
